//
//  Entity.m
//  NuevoMundo
//
//  Created by Bob Rosset on 11/21/10.
//  Copyright 2010 Bob Rosset. All rights reserved.
//

#import "Entity.h"


@implementation Entity

@synthesize sprite;


-(id)init
{
	sprite = [[CCSprite alloc] init];
	sprite.position = ccp([[CCDirector sharedDirector] winSize].width/2, [[CCDirector sharedDirector] winSize].height/2);
	
	return self;
}


-(id)initWithSprite:(NSString*)spriteName
{
	sprite = [[CCSprite spriteWithFile:spriteName] retain];
	sprite.position = ccp([[CCDirector sharedDirector] winSize].width/2, [[CCDirector sharedDirector] winSize].height/2);
	
	return self;
}


-(id)initWithSpriteFrame:(CCSpriteFrame*)spriteFrame
{
	sprite = [[CCSprite spriteWithSpriteFrame:spriteFrame] retain];
	sprite.position = ccp([[CCDirector sharedDirector] winSize].width/2, [[CCDirector sharedDirector] winSize].height/2);
	
	return self;
}


-(CGPoint) position
{
	return sprite.position;
}


-(void) setPosition:(CGPoint)position
{
	sprite.position = position;
}


-(void) dealloc
{
	[sprite release];
	[super dealloc];
}

@end
